<meta charset="UTF-8">
<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

session_start();
include("conn/conn.php");

$name=$_POST['username'];
$pwd=$_POST['password1'];
switch ($_POST['sex']){
case 1:
    $sex = '男';
    break;
case 2:
    $sex = '女';
    break;
default :
    break;
}
$age=$_POST['age'];
$tel=$_POST['tel'];
$reserved_info=$_POST['reserved_info'];

$conn = prepare();
exectue_sql_statement($conn, "insert into Members(members_name,members_password,reserved_information,members_sex,members_age,members_tel) values ('$name','$pwd','$reserved_info','$sex',$age,$tel)");
//session_register("username");
//$username=$name;
//session_register("producelist");
//$producelist="";
//session_register("quatity");
//$quatity="";
$_SESSION['username'] = $name;
$_SESSION['producelist'] = "";
$_SESSION['quatity'] = "";
echo "<script>alert('恭喜，注册成功!');window.location='index.php';</script>";
?>